<%= render :partial => 'application/breadcrumb_path', :locals  => { :projectscrumb=>true, :path => [@privateStudentGroup] } %>

<section id="student_group">
  <div class="category_info">
    <div class="left_info">
      <!-- corner -->
      <div class="corner-item">
        <div class="corner-item2">
          <div class="corner-color"></div>
          <i class="fa fa-group"></i>
        </div>
        <div class="corner-background"></div>
      </div>

      <div class="container-img">

        <div class="img-box"><i class="fa fa-group"></i></div>

      </div>
    </div>

    <div class="information">
      <div class="briefing">
        <header>
          <div class="icontitle">
            <!--ayuda-->
            <%= render partial: 'help/help_private_student' %>
            <!--titulo-->
            <h1><%= @privateStudentGroup.title %></h1>
            <div class="author">
							<span class="by"><%= t('by') %></span> <%= link_to @privateStudentGroup.private_teacher.name, @privateStudentGroup.private_teacher.subject %>
							Autor
						</div>
          </div>
        </header>
        <div class="toolbar-profile">
          <div class="btn-group js_update_profile_info">
            <a id="notification_settings_button" class="btn btn-default btn-for-categorize" data-toggle="modal" data-target="#notifications_modal"><i class='fa fa-bell'></i>Notification Settings</a>
            <!--remove-->
						<a class="btn btn-default btn-for-categorize" href="<%=credentials_private_student_group_path(@privateStudentGroup)%>"><i class='fa fa-download'></i>Download credentials</a>
          <% if can?(:destroy, @privateStudentGroup) %>
            <%= link_to(raw("<i class='fa fa-trash'></i>") + t('excursion.actions.delete') , @privateStudentGroup, :method => :delete, :remote => false, :confirm => "Are you sure?", :class =>"action btn btn-default" )%>
          <% end %>
          </div>
        </div>
      </div>
    </div>
  </div>

  <section class="info-profile">

    <ul class="nav nav-tabs">
          <!--excursions-->
          <li class="active">
            <a id="pupils_tab" href="#tabPupils" data-toggle="tab">
              <i class="fa fa-group"></i>
              <span class=" hidden-xs"><%=t('private_student.tabs.pupils_tab')%></span>
            </a>
          </li>
          <li class="">
            <a id="excursions_tab" href="#tabExcursions" data-toggle="tab">
              <i class="fa fa-book"></i>
              <span class=" hidden-xs"><%=t('private_student.tabs.excursions_tab')%></span>
            </a>
          </li>
    </ul>


<div class="tab-content">
  <div class="tab-pane active" id="tabPupils">

    <table id="student_table" cellspacing='0' class="table table-striped">
      <tbody>
      <% @privateStudentGroup.private_students.each do |user| %>
        <tr>
           <td class="student_name">
            <i class="fa fa-user"></i>
            <a href="<%=user_path(user)%>" target="_blank"><%=user.name%></a>
          </td>
        </tr>
      <% end %>
      </tbody>
    </table>
  </div>


  <div class="tab-pane" id="tabExcursions">
    <% if @excursions.length > 0 %>
      <div class="entities excursions">
        <ul class="items">
        <% @excursions.each do |excursion| %>
          <%= render :partial => 'excursions/excursion', :locals => { :excursion => excursion } %>
        <% end %>
        </ul>
      </div>
    <% end %>
  </div>
</div>


</section>

<!-- Notifications modal -->
<div class="modal fade" id="notifications_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">Configurar notificaciones</h4>
      </div>
      <div class="modal-body">
            <%= form_for @privateStudentGroup, as: :post, url: {:action =>'change_teacher_notifications'}, method: :change_teacher_notifications do |f| %>
            <label>Configurar notificaciones</label>
            <p>¿Cuando quiere recibir notificaciones de este grupo?</p>
            <%= f.select(:teacher_notification, options_for_select([["Cuando suban cualquier tipo de recurso","ALL"],["Sólamente al publicar excursiones","PUBLISHING"], ["Nunca","NONE"]], :selected => @privateStudentGroup.teacher_notification))%>
          </div>
        <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
        <%= f.submit t('save'), :class => 'btn btn-default'  %>
        <%end %>
      </div>
    </div>
  </div>
</div>
